package com.example.demo.config;

import com.example.demo.Util.FeishuiUtil;
import com.example.demo.result.ResponseResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ExceptionConfig {
    @ExceptionHandler(Exception.class)
    public ResponseResult handleException(Exception e) {
        e.printStackTrace();
        FeishuiUtil.post(e.getMessage());
        return new ResponseResult().error(500, e.getMessage());
    }
}
